<?php
/**
 * @package     Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$root_path = JURI::root();

//get data
$data_slide = ContentHelperCnsolution::getDataSlide(intval($this->catid_slide));
$data_home = ContentHelperCnsolution::getHomeAticles(intval($this->catid_home));
?>

<!-- SLIDER -->
<div id="ei-slider" class="ei-slider">
    <ul class="ei-slider-large">
        <?php foreach($data_slide as $value):?>
        <?php
            //data big image
            $value_img_obj = json_decode($value->images);
            $big_image['link_image'] = $value_img_obj->image_fulltext;
            $big_image['alt']  = $value_img_obj->image_fulltext_alt;
            $big_image['caption']  = $value_img_obj->image_fulltext_caption;
            //$links_article = JRoute::_('index.php?option=com_content&view=article&id='.$value->id);
            
            //get link article
            $slug = $value->alias ? ($value->id . ':' . $value->alias) : $value->id;
            $links_article = JRoute::_(ContentHelperRoute::getArticleRoute($slug, $value->catid, $value->language));
        ?>
            <li>
            <a href="<?php echo $links_article; ?>">    
                <img src="<?php echo $root_path.$big_image['link_image']; ?>" 
                     alt="<?php echo $big_image['alt']; ?>" 
                     caption="<?php echo $big_image['caption']; ?>" class="responsiveslide">
            </a>
            <div class="ei-title">
                    <h2>CT Solution</h2>
                    <h3><?php echo $big_image['alt']; ?></h3>
            </div>
            </li>   
        <?php endforeach; ?>
    </ul>
    <!--  slider-thumbs -->
    <ul class="ei-slider-thumbs">
        <li class="ei-slider-element">Current</li>
        <?php foreach($data_slide as $value):?>
        <?php
            //data small image
            $value_img_obj = json_decode($value->images);
            $small_image['link_image'] = $value_img_obj->image_intro;
            $small_image['alt']  = $value_img_obj->image_intro_alt;
            $small_image['caption']  = $value_img_obj->image_intro_caption;
        ?>
            <li><a href="#"><?php echo $small_image['alt']; ?></a>
                <img src="<?php echo $root_path.$small_image['link_image']; ?>" 
                     class="slideshowthumb" alt="<?php echo $small_image['alt'] ?>"
                     caption="<?php echo $small_image['caption']; ?>" />
            </li>
        <?php endforeach; ?>
    </ul>	
</div>
<div class="minipause">
</div>

<!-- SUBHEADER
================================================== -->

<div id="subheader">
    <div class="row">
        <div class="twelve columns">
            <p class="text-center">
                    "Vision is the art of seeing what is invisible to others" - Jonathan Swift
            </p>
        </div>
    </div>
</div>

<!-- ANIMATED COLUMNS 
================================================== -->
<div class="row">
    <div class="twelve columns">
        <ul class="ca-menu">
            <li>
            <a href="#">
            <span class="ca-icon">F</span>
            <div class="ca-content">
                    <h2 class="ca-main">Responsive<br/> Design</h2>
                    <h3 class="ca-sub">Across all major devices</h3>
            </div>
            </a>
            </li>
            <li>
            <a href="#">
            <span class="ca-icon">H</span>
            <div class="ca-content">
                    <h2 class="ca-main">Friendly<br/> Documentation</h2>
                    <h3 class="ca-sub">Straight to the point</h3>
            </div>
            </a>
            </li>
            <li>
            <a href="#">
            <span class="ca-icon">N</span>
            <div class="ca-content">
                    <h2 class="ca-main">Alternate<br/> Home Pages</h2>
                    <h3 class="ca-sub">Full slider, boxed or none</h3>
            </div>
            </a>
            </li>
            <li>
            <a href="#">
            <span class="ca-icon">K</span>
            <div class="ca-content">
                    <h2 class="ca-main">Filterable<br/> Portofolio</h2>
                    <h3 class="ca-sub">Isotop & PrettyPhoto</h3>
            </div>
            </a>
            </li>
        </ul>
    </div>
</div>

<!-- CONTENT 
================================================== -->
<div class="row">
    <div class="twelve columns">
        <div class="centersectiontitle">
                <h4>What we do</h4>
        </div>
    </div>
    <?php 
        foreach($data_home as $value): 
            //get link article
            $slug = $value->alias ? ($value->id . ':' . $value->alias) : $value->id;
            $link_article = JRoute::_(ContentHelperRoute::getArticleRoute($slug, $value->catid, $value->language));;
    ?>
    <div class="four columns">
        <h5><?php echo $value->title;  ?></h5>
            <?php echo ContentHelperCnsolution::truncateDataFilter($value->content, 30);?>
        </p>
        <p>
                <a href="<?php echo $link_article ?>" class="readmore">Learn more</a>
        </p>
    </div>
    <?php endforeach; ?> 
</div>
<div class="hr">
</div>

<!-- TESTIMONIALS 
================================================== -->
<div class="row">
    <div class="twelve columns">
        <div id="testimonials">
            <blockquote>
                <p>
                         "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis." <cite>Martin - NY</cite>
                </p>
            </blockquote>
            <blockquote>
                <p>
                         "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco." <cite>Sandra - LA</cite>
                </p>
            </blockquote>
            <blockquote>
                <p>
                         "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco." <cite>Jason - MA</cite>
                </p>
            </blockquote>
        </div>
        end testimonials
    </div>
</div>
